<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>保存产品成功管理</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
		$(document).ready(function() {
			//$("#name").focus();
			$("#inputForm").validate({
				submitHandler: function(form){
					loading('正在提交，请稍等...');
					form.submit();
				},
				errorContainer: "#messageBox",
				errorPlacement: function(error, element) {
					$("#messageBox").text("输入有误，请先更正。");
					if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
						error.appendTo(element.parent().parent());
					} else {
						error.insertAfter(element);
					}
				}
			});
		});
	</script>
</head>
<body>
	<ul class="nav nav-tabs">
		<li><a href="${ctx}/mid/goodInfo/">产品列表</a></li>
		<li class="active"><a href="${ctx}/mid/goodInfo/form?goodInfoId=${goodInfo.goodInfoId}">产品<shiro:hasPermission name="good:goodInfo:edit">${not empty goodInfo.goodInfoId?'修改':'添加'}</shiro:hasPermission></a></li>
	</ul><br/>
	<form:form id="inputForm" modelAttribute="goodInfo" action="${ctx}/mid/goodInfo/save" method="post" class="form-horizontal">
		<form:hidden path="goodInfoId"/>
		<form:hidden path="gEngDesc"/>
		<form:hidden path="isvalid"/>
		<sys:message content="${message}"/>
		<div class="control-group">
			<label class="control-label">英文名称：</label>
			<div class="controls">
				<label>${goodInfo.gEngDesc}</label>
			</div>
		</div>
		
		<div class="control-group">
			<label class="control-label">产品品牌：</label>
			<div class="controls">
				<form:input path="gProductBrand" htmlEscape="false" maxlength="255" class="input-xlarge "/>
			</div>
		</div>
		<c:if test="${goodInfo.tType=='bjp'}">
		<div class="control-group">
			<label class="control-label">产品条形码：</label>
			<div class="controls">
				<form:input path="gBarCode" htmlEscape="false" maxlength="255" class="input-xlarge "/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">产品规格：</label>
			<div class="controls">
				<form:input path="gSpecifications" htmlEscape="false" maxlength="255" class="input-xlarge "/>
			</div>
		</div>
		</c:if>
		<div class="control-group">
			<label class="control-label">产品类型：</label>
			<div class="controls">
				<form:select path="tType"
				class="input-medium ">
				<form:options items="${fns:getDictList('product_type')}"
					itemLabel="label" itemValue="value" htmlEscape="false" /></form:select>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">中文名：</label>
			<div class="controls">
				<form:input path="gChineseDesc" htmlEscape="false" maxlength="255" class="input-xlarge "/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">产品描述：</label>
			<div class="controls">
				<form:input path="gDescribe" htmlEscape="false" maxlength="255" class="input-xlarge "/>
			</div>
		</div>
		<c:if test="${goodInfo.tType=='bjp'}">
		<div class="control-group">
			<label class="control-label">重量：</label>
			<div class="controls">
				<form:input path="weight" htmlEscape="false" class="input-xlarge "/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">单一重量上限：</label>
			<div class="controls">
				<form:input path="singleWLimit" htmlEscape="false" class="input-xlarge "/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">混合重量上限：</label>
			<div class="controls">
				<form:input path="mixWLimit" htmlEscape="false" class="input-xlarge "/>
			</div>
		</div>
		</c:if>
		<c:if test="${goodInfo.tType!='bjp'}">
		<div class="control-group">
			<label class="control-label">容量：</label>
			<div class="controls">
				<form:input path="gCapacity" htmlEscape="false" maxlength="255" class="input-xlarge "/>
			</div>
		</div>
		</c:if>
		<!-- <div class="control-group">
			<label class="control-label">是否可用：</label>
			<div class="controls">
				<form:select path="isvalid" class="input-xlarge" >
					<form:options items="${fns:getDictList('yes_no')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
				</form:select>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">采购价：</label>
			<div class="controls">
				<form:input path="purchasingPrice" htmlEscape="false" class="input-xlarge "/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">库存下限：</label>
			<div class="controls">
				<form:input path="inventoryMin" htmlEscape="false" maxlength="16" class="input-xlarge "/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">库存上限：</label>
			<div class="controls">
				<form:input path="inventoryMax" htmlEscape="false" maxlength="16" class="input-xlarge "/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">库存：</label>
			<div class="controls">
				<form:input path="inventory" htmlEscape="false" maxlength="16" class="input-xlarge "/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">货号：</label>
			<div class="controls">
				<form:input path="articleNumber" htmlEscape="false" maxlength="50" class="input-xlarge "/>
			</div>
		</div> -->
		<div class="control-group">
			<label class="control-label">平台：</label>
			<div class="controls">
				<form:select path="platformType"
				class="input-medium ">
				<form:option value="0" label="请选择" />
				<form:options items="${fns:getDictList('sys_user_type')}"
					itemLabel="label" itemValue="value" htmlEscape="false" /></form:select>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">${goodInfo.tType!='bjp'?'成本价':'重量价格'}：</label>
			<div class="controls">
				<form:input path="nPrice" htmlEscape="false" maxlength="16" class="input-xlarge "/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">${goodInfo.tType!='bjp'?'包邮价':'实际出货价格'}：</label>
			<div class="controls">
				<form:input path="nSellprice" htmlEscape="false" maxlength="50" class="input-xlarge "/>
			</div>
		</div> 
		<table id="contentTable" class="table table-striped table-bordered table-condensed">
		<thead>
			<tr>
				<th>平台</th>
				<c:if test="${goodInfo.tType!='bjp'}">
				<th>
					成本价
				</th>
				<th>
				      包邮价
				</th>
				</c:if>
				<c:if test="${goodInfo.tType=='bjp'}">
				<th>
					重量价格
				</th>
				<th>
				      实际出货价格
				</th>
				</c:if>
			</tr>
		</thead>
		<tbody>
		<c:forEach items="${page}" var="platform">
			<tr>
				<td>
					${fns:getDictLabel(platform.platformType, "sys_user_type", "")}
				</td>
				<td>
					${platform.nPrice}
				</td>
				<td>
					${platform.nSellPrice}
				</td>
			</tr>
		</c:forEach>
		</tbody>
	</table>
		<div class="form-actions">
			<shiro:hasPermission name="good:goodInfo:edit"><input id="btnSubmit" class="btn btn-primary" type="submit" value="保 存"/>&nbsp;</shiro:hasPermission>
			<input id="btnCancel" class="btn" type="button" value="返 回" onclick="history.go(-1)"/>
		</div>		
	
	</form:form>
</body>
</html>